package com.hzj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzj.pojo.Schedule;
import com.hzj.mapper.ScheduleMapper;
import com.hzj.service.ScheduleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 医生日程安排表 服务实现类
 * </p>
 *
 * @author hzj
 * @since 2021-04-26
 */
@Service
public class ScheduleServiceImpl extends ServiceImpl<ScheduleMapper, Schedule> implements ScheduleService {
    @Autowired
    private ScheduleMapper sm;

    @Override
    public boolean updateAndSave(Schedule schedule) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("hosScheduleId", schedule.getHosScheduleId());

        return saveOrUpdate(schedule, wrapper);
    }
}
